#include <iostream>
using namespace std;

int a[100005];
int dp[100005];
int c[100005];

int main() {
	int T;
	cin >> T;
	bool first = true;
	for (int kase=1; kase<=T; kase++) {
		int n;
		cin >> n;
		for (int i=0; i<n; i++) {
			cin >> a[i];
		}
		dp[0] = a[0];
		c[0] = 0;
		int prev = 0;
		for (int i=1; i<n; i++) {
			if (a[i] > a[i]+dp[i-1]) {
				dp[i] = a[i];
				prev = i;
				c[i] = i;
			} else {
				dp[i] = a[i]+dp[i-1];
				c[i] = prev;
			}
		}
		int maxdp=-0x7F7F7F7F, start, end;
		for (int i=0; i<n; i++) {
			if (maxdp < dp[i]) {
				maxdp = dp[i];
				start = c[i];
				end = i;
			}
		}
		if (first) first = false;
		else cout << endl;
		cout << "Case " << kase << ":\n";
		cout << maxdp << " " << start+1 << " " << end+1 << endl;
	}
	return 0;
}
